package com.yyi.springcloud.controller;


import com.yyi.springcloud.entities.TestProdInfoItemModel;
import com.yyi.springcloud.service.Local_TestProdInfoItemService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/mysqlapi/TestProdInfoItem")
public class Mysql_TestProdInfoItemController {
	@Resource
	private Local_TestProdInfoItemService testProdInfoItemService;

	// http://localhost:8080/bxxs/mysqlapi/TestProdInfoItem/getAllTestProdInfoItem
	@ResponseBody
	@RequestMapping(value = "/getAllTestProdInfoItem", method = RequestMethod.GET)
	public List<TestProdInfoItemModel> getSensorInfo(String labcode) {
		TestProdInfoItemModel testProdInfoItemModel = new TestProdInfoItemModel();
		if (!StringUtils.isEmpty(labcode)) {
			testProdInfoItemModel.setLabcode(labcode);
		}
		List<TestProdInfoItemModel> testProdInfoItemList = testProdInfoItemService
				.getTestProdInfoItemByCondition(testProdInfoItemModel);
		return testProdInfoItemList;
	}
}
